import 'package:aio/aio.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:app/generated/app_strings.dart';
import 'package:app/src/http/bean/works_2023/material_review_info.dart';
import 'package:app/src/http/bean/wroks/contract_bean.dart';
import 'package:app/src/ui/dialog/dailog.dart';
import 'package:app/src/ui/route/works/public/items/ui_base.dart';
import 'package:app/src/ui/route/works/public/items/ui_card.dart';
import 'package:app/src/ui/route/works/type18_contract_royalty_rate_apply_check/item/ui_contractroyaltyrateapplycheckchange.dart';

import '../../../../../http/bean/works_2023/contractroyaltyrateapplycheck_bean.dart';
import '../../../../../http/bean/works_2023/report_loss_bean.dart';

///五金领用审核（基本信息）
class UiHardwareApproval {
  ///data 信息
  ///oldData 历史信息
  static Widget build(
      BuildContext context, MaterialReviewInfoBean? data, MaterialReviewInfoBean? oldData,
      {String? title}) {
    List<Widget> children = [];
    if (StringUtils.isEmpty(title)) {
      title = AppStrings.of(context).BaseInfo; //基本信息
    }
    children.add(UiBase.title(context, title)); //标题
    children.add(UiBase.item(
      context,
      AppStrings.of(context).UserPersonName,
      data?.txtUser,
      oldData?.txtUser,
    )); //申请人
    children.add(UiBase.item(
        context,
        AppStrings.of(context).txtDept,
        data?.txtDept,
        oldData?.txtDept)); //所属部门
    children.add(UiBase.item(context, AppStrings.of(context).txtGroup,
        data?.txtGroup, oldData?.txtGroup)); //所属班组
    children.add(UiBase.item(context, AppStrings.of(context).lblOrderCode,
        data?.lblOrderCode, oldData?.lblOrderCode)); //所属订单
    children.add(UiBase.item(
      context,
      AppStrings.of(context).txtMaterItemRemarks,
      data?.txtMaterItemRemarks,
      oldData?.txtMaterItemRemarks,
    )); //说明
    var column = UiBase.column(context, children);
    var card = UiCard.build(context, column);
    return card;
  }
}
